package com.badshun.box2d;

import com.badlogic.gdx.physics.box2d.*;
import com.badlogic.gdx.graphics.*;
import com.badlogic.gdx.math.*;
import com.badshun.player.*;
import com.badshun.stage.*;

public class Box2DWorld {
	public World world;
	private Box2DDebugRenderer render;
	
	private OrthographicCamera camera;
	
	public Box2DWorld(OrthographicCamera camera) {
		this.camera = camera;
		
		world = new World(new Vector2(0,0),true);
		render = new Box2DDebugRenderer();
	}
	
	public void setContactListener(MainPlayer main,NPCPlayers npcs,EnvironmentStageManager esm) {
		world.setContactListener(new Box2DContactListener(main,npcs,esm));
	}
	
	public void render() {
		world.step(1 / 60f,6,2);
		render.render(world,camera.combined);
	}
}
